package com.kb.design.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kb.design.common.ApiResponse;
import com.kb.design.common.ResponseObject;
import com.kb.design.dto.DesignFileDTO;
import com.kb.design.entity.DesignFile;
import com.kb.design.service.DesignFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 附件表 前端控制器
 * </p>
 *
 * @author author
 * @since 2023-11-14
 */
@RestController
@RequestMapping("/file")
public class DesignFileController {

    @Autowired
    private DesignFileService designFileService;
    /**
     * 分页查询
     *
     * @param
     * @return 查询结果
     */
    @PostMapping("pageSearch")
    public ApiResponse pageSearch(@RequestBody DesignFileDTO designFileDTO) {
        Page<DesignFile> designRequirementPage = designFileService.queryByPage(designFileDTO);
        return ApiResponse.success(new ResponseObject(designRequirementPage.getRecords(),designRequirementPage.getTotal()));
    }
}
